package com.banyuan.HomeWork.interfacedemo;

public class Rectangle extends Shape {
    private int width;
    private int height;

    public Rectangle() {
    }

    public Rectangle(String color, int width, int height) {
        super(color);
        this.width = width;
        this.height = height;
    }

    @Override
    public double getArea() {
        return width * height;
    }

    @Override
    public double getPer() {
        return 2 * (width + height);
    }

    @Override
    public void show() {
        System.out.println("该长方形的面积是：" + this.getArea());
        System.out.println("该长方形的周长是：" + this.getPer());
        System.out.println("该长方形的颜色是：" + this.getColor());
    }


}
